Unions

  • Syntax:

    union type_name {
        field_type1 field_name1;
        field_type2 field_name2;
        field_type3 field_name3;
        .
        .
    } variables_with_this_type;
    
  • All its member elements occupy the same physical space in memory.

  • The size of this type is the one of the largest member element.

  • We can use according to how we want to access these bytes.